home *** CD-ROM | disk | FTP | other *** search
-
- "THE BEGINNING"
-
- So you purchased a 520ST computer. You did so because of its price (a-
- huh), but also because is was advertised as being a "powerful" computer using
- Motorola's FAST "68000 CPU". So you rush home with your computer, monitor, and
- disk drive and put it all together. Then you get a fancy word processor and new
- printer, and, voila', you can now write letters to your Aunt May!
-
- Five weeks later (maybe sooner if you read ST Log) you begin to notice
- that your FAST computer runs everything at "great-guns" until it comes time to
- print out that letter to Aunt May. The computer then slows down to an "ants
- pace" (pun intended) while it WAITS for your slow-as-molasses printer to punch
- out that letter. Isn't there a faster and better way to print out that letter
- without spending any more money? YES!!!! Why not use your speedy computer to
- store your letter in a buffer, sending it to your printer character-by-charac-
- ter at the printer's slow pace, and otherwise running other wonderful programs
- that you tell it to.
-
- And that's what a "Yet Another Printer Spooler" (YAPS for short) does
- for you. This little program wedges itself permanently in memory (or until you
- turn off or reset your computer). It then patches itself into the operating
- system (low level BIOS calls) and waits for someone to send a character to the
- printer. When that happens, it checks to see if your printer is busy printing a
- character. If the printer is not YAPS sends it a character to print. However,
- if it is busy, YAPS will store that character in a buffer and return to your
- program. Then YAPS "wakes up" and checks to see if your printer is ready to
- receive another character. If so, it sends one on and then returns control to
- any program you happen to be running.
-
-
- "THE SETUP"
-
- "Yet Another Printer Spooler" works with practically all printers that
- connect to the Centronics Printer Port in the back of your ST computer. It will
- even work with some printers that do not work with TOS (see below for Why?).
- YAPS can be run at any time to set up its buffer and patch itself into the
- operating system, but is probably MOST effective if run at the time you turn on
- your computer.
-
- There are two (2) versions of YAPS included in the arc'd file,
- YAPS_C.PRG and YAPS_T.PRG. YAPS_C.PRG uses the Centronics Busy Signal
- interrupt to know when to send characters to your printer. It therefore is the
- most efficient of the two versions, and runs generally faster (especially if
- graphic information is being sent to the printer, as with Publishing Partner).
- YAPS_T.PRG runs off of timer C. This version is compatible with more printers
- than YAPS_C.PRG, but may, in certain instances, run noticeably slower. Try
- using YAPS_C.PRG first, switching to YAPS_T.PRG if you have problems with a
- particular application or printer.
-
- Before you run YAPS you should decide how big a buffer you want
- to be set up. The default size is a 32 k (kilobyte) buffer, but any size up to
- the available size of your memory can be set up! You must then change the name
- of the program you want to use to reflect the size of the buffer you want to
- set up. For instance, if you run "Yet Another Printer Spooler" with the name
- YAPS64.PRG a 64 k buffer will be set up to store printer characters. If you own
- one of the new MEGA ST's and want to set up a 1500 k buffer (a whopping size),
- then you would rename the program YAPS1500.PRG before running it. The smallest
- size buffer that can be set up is 1 kilobyte in length (YAPS1.PRG). Remember,
- however, that the program name must begin with YAPS and have an extension of
- PRG for everything to work properly.
-
- The program can be run from the GEM desktop. However, you can also
- start YAPS automatically. To do so, format a new diskette, and create a
- folder called AUTO. Then copy all programs that you wish to run at the time
- you turn on your ST computer into this folder, INCLUDING the YAPS file that
- you just renamed. The next time you turn on your computer make sure that this
- diskette is in DRIVE A, and "Yet Another Printer Spooler" will load in auto-
- matically.
-
-
- "SOME ADDITIONAL FEATURES"
-
- There are a few more features that YAPS has to make your life easier:
-
- (1) When YAPS is run, if you press either the "Alternate", "Shift", or
- "Control" keys, the installation of the printer spooler will be
- aborted. A somewhat rude message will appear then, telling you
- of the abortion (I mean aborted installation...). You can still
- load in YAPS at any time from the GEM desktop. Remember to first
- rename the program to reflect the size of the printer buffer that
- you want to be set up.
-
- (2) If there is not enough memory available to set up the buffer size
- specified in the program name, installation will be aborted, and
- a message printed on your screen indicating this.
-
- (3) If YAPS can not interpret the size of the buffer needed, or can
- not find the program name, a 32 k (default) buffer will be set up.
-
- (4) There is a way to CLEAR the buffer before YAPS has completed
- spooling the characters to your printer. If you run the program
- again after it has already been installed, you will get a message
- indicating that the printer spooler is running, and asking if you
- want to clear to buffer. Press "Y" to do so, or "N" not to stop
- the printing.
-
-
- "THE TECHNICAL ASPECTS"
-
- "Yet Another Printer Spooler" is written in assembly language using
- Abacus's ASSEMPRO. It works by stealing the BIOS (trap #13) vector from the
- operating system, and then checks for CONOUT and CONSTAT calls directed at
- the printer. All other BIOS calls are passed on to the operating system.
-
- As the program starts it first checks to see if another version of YAPS
- has already been installed by looking for the 8 byte name "YAPS.PRG" near the
- beginning of the trap #13 code. If the name is found, the program informs the
- user that "Yet Another Printer Spooler" is already active. It then gives the
- option to clear the printer buffer of its contents.
-
- In the next step YAPS looks for its name by doing a GEMDOS directory
- search using the wildcard mask "YAPS*.PRG". If no match is found in the current
- directory, YAPS will look for a match in an AUTO folder. I know of no other way
- to get the program name other that doing a directory search, and still be able
- to run YAPS in an AUTO folder. There is an inherent limitation; YAPS will find
- the FIRST match to the wildcard mask, and NOT necessarily the actual program
- name run. For instance, suppose a copy of YAPS is kept BOTH in the root direct-
- ory (ie. - not in any folder) AND in an AUTO folder of a boot diskette. The
- filename in the root directory will ALWAYS be found first. This filename ONLY
- will be used to determine the size of the printer buffer to set up even if the
- program is run from the AUTO folder when the computer is booted. So a good rule
- of thumb when using YAPS is to try NOT to keep multiple copies of the program
- around on the same diskette.
-
- After the buffer size is determined, YAPS then either ties in the
- printer spooler portion of the program to the 200 hz. system timer (TIMER C of
- the MFP chip) or sets up the Centronics Busy Signal Interrupt Routine
- (depending on what version of YAPS you are running). YAPS_T.PRG uses the XBIOS
- SETEXEC call to find the current TIMER C vector, then uses the same call to
- chain the printer spooler routine with the current TIMER C handler. I chose
- to use TIMER C in order to be compatible with most other applications run.
- Using TIMER A and resetting to a faster speed (lets say 700 hz.) may increase
- to speed of spooling with those printers that have no more than 1 line of
- buffer, but at the cost of being potentially incompatible with other
- applications that may use this timer for there own purposes. For the vast
- majority of printers the speed of printing should be no different with the
- spooler as compared to the operating system calls.
-
- If you plan to print graphic material with your printer (as with many
- drawing and publishing programs currently available), you will find that the
- timer C version will not be able to feed the graphic information to your
- printer as fast as it can handle it. Your printing can, in fact, run SLOWER in
- these cases than if you did not have any printer spooler installed. For this
- reason a second version of YAPS is supplied, YAPS_C.PRG. This version runs off
- of the Centronics Busy Signal Interrupt (also of the MFP chip); that is it
- sends characters to the printer at the exact time the printer is ready to
- receive characters, not by polling the state of the printer when using TIMER C.
- This version may potentially not be compatible with some applications, since
- it steals rather than chains to the Centronics Busy Signal Interrupt Vector
- (I have yet to find any application that it can not run with so far). This
- version of YAPS may also not driver certain printers properly (such as the
- Texas Instruments model 810), though it will probably work with more than 98%
- of printers currently on the market.
-
- To finalize the setup, the SETEXEC call is again used to steal the
- trap #13 (BIOS) vector. Finally the program is exited using the GEMDOS KEEP
- call to retain the printer spooler with its buffer in memory.
-
- I originally wrote this printer spooler to work with Texas Instruments
- (TI) 810, 880, and 850 printers (these are heavy duty printers frequently used
- by the airlines and ticket agencies). These three printers do not work with
- the current operating system print routines. If these printers are attached to
- any ST computer, DUPLICATE characters will be appear on any document printed.
- The fault lies with each manufacturers interpretation of the Centronics Para-
- llel Interface Protocol. In order for the printer to grab or "latch" on to a
- character to print, it has to know when the character is available. The compu-
- ter signals the printer when ready by flashing a flag called the STROBE. The
- STROBE signal must be pulsed a minimal amount of time before the printer will
- recognize that there is a character to print and grab it. The Parallel Inter-
- face Protocol specifies this MINIMAL time to be either 0.5 or 1 microsecond for
- almost all printers. The protocol does NOT specify a MAXIMUM time, and that is
- where that problem arises with some printers. Most printers (let's say 95%) not
- only wait for this STROBE flag to be raised (or technically set LOW), but they
- also wait for the STROBE flag to be dropped (or technically set HIGH) before
- they process the character and look for another one. A few printers latch onto
- and process the character sent to them as soon as the STROBE flag is raised.
- After they finish processing the character, if the STROBE flag is still raised,
- they latch onto the same character and print it! It then becomes critical that
- the ST computer flash the STROBE as near to the minimal time specified in the
- Parallel Interface Protocol as possible in order to work properly with these
- "few" printers.
-
- The STROBE signal is controlled by the Yamaha YM-2149 Programmable
- Sound Generator (PSG) chip. The normal BIOS call to send a character to the
- printer pulses the STROBE for greater than 8 microseconds. Mind you this pulse
- width agrees with the Centronics Parallel Interface Protocol (since only a min-
- imal time is specified), but is too long for a few printers. I have optimized
- the code that loads the PSG chip with a character and flashes the strobe (only
- four assembly instructions long). This decreases the STROBE pulse width to
- 1.5 to 2 microseconds (a limitation of the PSG chip, not the 68000 CPU), small
- enough to make a big difference! Now all the TI 880 and 885 printers work
- perfectly fine with the ST computer IF YAPS IS INSTALLED FIRST BEFORE PRINTING.
- The TI 810 printers are apparently more finicky unfortunately. One out of two
- printers that I have at my office works fine. The other will duplicate 1 char-
- acter out of 20,000 characters (yes, that's twenty thousand) sent to it on the
- average. This patch is not perfect, but darn well tries to be so. And at least
- with YAPS_T.PRG installed I estimate that with YAPS installed you can use more
- than 99% of Centronics compatible printers currently available on the market!
-